<?php

use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;

class Wishs extends AbstractMigration
{
    public function up()
    {
        $table = $this->table('wishs');
        $table->addColumn('user_id', 'integer', array('comment' => '用户id','null' => true))
              ->addColumn('start_date', 'date', array('comment' => '开始日期'))
              ->addColumn('end_date', 'date', array('comment' => '结束日期'))
              ->addColumn('country', 'integer', array('limit' => MysqlAdapter::INT_REGULAR,'comment' => '营地所属国家','null' => true)) 
              ->addColumn('province', 'integer', array('limit' => MysqlAdapter::INT_REGULAR,'comment' => '营地所属省份','null' => true)) 
              ->addColumn('city', 'integer', array('limit' => MysqlAdapter::INT_REGULAR,'comment' => '营地所属城市','null' => true))
              ->addColumn('offer', 'integer', array('default' => 0, 'comment' => '金额'))
              ->addColumn('score', 'integer', array('default' => 0, 'comment' => '积分'))
              ->addColumn('status', 'integer', array('default' => 0, 'limit' => MysqlAdapter::INT_TINY, 'comment' => '状态'))
              ->addColumn('type', 'integer', array('default' => 1, 'limit' => MysqlAdapter::INT_TINY, 'comment' => '类型'))
              ->addColumn('created_at', 'timestamp', array('default' => 'CURRENT_TIMESTAMP'))
              ->addColumn('updated_at', 'timestamp', array('null' => true))
              ->addColumn('deleted_at', 'timestamp', array('null' => true))
              ->save();   
    }
    public function down()
    {
        $this->dropTable('wishs');
    }
}
